def count (area: String){ val arr=Array("115036,147779,广东,广州,中国移动,020,51000", "115038,1477801,广东,东莞,中国移动,0769,511700", "115033,1477796,广东,广州,中国移动,020,510000", "115032.1477795,广东,广州,中国移动,020,510000") var sum=0 for(a<-arr; if a.contains(area)){ sum+=1} println(sum) }

scala> count("广州")